package com.guigu.equipmentservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 操作日志表（记录操作员的所有系统操作，用于审计和问题排查）
 * </p>
 *
 * @author zcy
 * @since 2025-09-28
 */
@TableName("operation_log")
public class OperationLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 日志唯一标识
     */
    @TableId(value = "log_id", type = IdType.AUTO)
    private Long logId;

    /**
     * 关联操作员表operator_id（操作人）
     */
    private Long operatorId;

    /**
     * 操作员姓名（冗余存储，避免关联查询，提高日志查询效率）
     */
    private String operatorName;

    /**
     * 操作时间（操作员执行操作的时间）
     */
    private LocalDateTime operationTime;

    /**
     * 操作模块（如用户管理、设备管理、订单管理）
     */
    private String operationModule;

    /**
     * 操作类型（查询/添加/编辑/删除/审核/退款等）
     */
    private String operationType;

    /**
     * 操作内容（详细描述操作，如"审核通过卖家资质，user_id=1001"）
     */
    private String operationContent;

    /**
     * 操作IP地址（记录操作员执行操作的设备IP）
     */
    private String operationIp;

    /**
     * 记录创建时间
     */
    private LocalDateTime createTime;

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public Long getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public LocalDateTime getOperationTime() {
        return operationTime;
    }

    public void setOperationTime(LocalDateTime operationTime) {
        this.operationTime = operationTime;
    }

    public String getOperationModule() {
        return operationModule;
    }

    public void setOperationModule(String operationModule) {
        this.operationModule = operationModule;
    }

    public String getOperationType() {
        return operationType;
    }

    public void setOperationType(String operationType) {
        this.operationType = operationType;
    }

    public String getOperationContent() {
        return operationContent;
    }

    public void setOperationContent(String operationContent) {
        this.operationContent = operationContent;
    }

    public String getOperationIp() {
        return operationIp;
    }

    public void setOperationIp(String operationIp) {
        this.operationIp = operationIp;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "OperationLog{" +
        "logId = " + logId +
        ", operatorId = " + operatorId +
        ", operatorName = " + operatorName +
        ", operationTime = " + operationTime +
        ", operationModule = " + operationModule +
        ", operationType = " + operationType +
        ", operationContent = " + operationContent +
        ", operationIp = " + operationIp +
        ", createTime = " + createTime +
        "}";
    }
}
